export const now = new Date();
export const nowYear = (now.getFullYear()).toString();
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  dialogWidth:'70%',
  printBtn: false,
  searchSize: 'mini',
  addBtn: false,
  delBtn: false,
  editBtn: false,
  selection: true,
  selectable: row => {
    return row.checkStatus == '0' || row.checkStatus == '3'
  },
  searchMenuSpan: 6,
  column: [{
    label: '标识',
    prop: 'id',
    hide: true,
    display: false
  }, {
    label: '单号',
    prop: 'numbers',
    display: false,
    disabled: true,
    search: true,
  }, {
    label: '作业时间',
    prop: 'workTime',
    type: 'year',
    format: 'yyyy',
    valueFormat: 'yyyy',
    search: true,
    searchValue: nowYear, 
    disabled: true,
    searchLabelWidth: 100
  }, {
    label: '周期',
    prop: 'workCycle',
    type: 'select',
    dicUrl: '/admin/dict/type/plan_cycle',
    search: true,
    disabled: true,
    rules: [{
      required: true,
      message: '请选择周期',
      trigger: 'blur'
    }]
  }, {
    label: '月份',
    prop: 'planMonth',
    disabled: true,
    formatter: (row,value,label,column) => {
      if(value){
        return value.split(',').map(m=>m+'月').join(',')
      }
    }
  }, {
    label: '已分解月份',
    prop: 'decomposeMonth',
    disabled: true,
    formatter: (row,value,label,column) => {
      if(value){
        return value.split(',').map(m=>m+'月').join(',')
      }
    }

  }, {
    label: '工作类型',
    prop: 'planType',
    type: 'select',
    dicUrl: '/admin/dict/type/plan_type',
    disabled: true,
    rules: [{
      required: true,
      message: '请选择计划类型',
      trigger: 'blur'
    }]
  }, {
    label: '票种',
    prop: 'ticketType',
    type: 'select',
    dicUrl: '/support/swpmticketcardtype/dict',
    props: {
      label: 'mainName',
      value: 'mainEnName'
    },
    search: true,
    disabled: true,
    rules: [{
      required: true,
      message: '请选择票种',
      trigger: 'blur'
    }]
  }, {
    label: '原计划数量',
    prop: 'planNumberOld',
    type: 'number',
    precision: 0,
    disabled: true,
    rules: [{
      required: true,
      message: '请输入原计划数量',
      trigger: 'blur'
    }]
  }, {
    label: '现计划数量',
    prop: 'planNumberNow',
    type: 'number',
    precision: 0,
    cell: true,
    rules: [{
      required: true,
      message: '请输入现计划数量',
      trigger: 'blur'
    }],
    width: 150
  }, {
    label: '已分解数量',
    prop: 'decomposeNumber',
    type: 'number',
    disabled: true,
    precision: 0,
    rules: [{
      required: true,
      message: '请输入已分解数量',
      trigger: 'blur'
    }]
  }, {
    label: '审批状态',
    prop: 'checkStatus',
    type: 'select',
    dicUrl: '/admin/dict/type/check_status',
    search: true,
    searchValue: '0', 
    addDisplay: false,
    editDisplay: false
  }, {
    label: '审核人',
    prop: 'checkPersonId',
    hide: true,
    addDisplay: false,
    editDisplay: false
  }, {
    label: '审核时间',
    prop: 'checkTime',
    hide: true,
    addDisplay: false,
    editDisplay: false
  }, {
    label: '是否分解完毕',
    prop: 'isDecompose',
    type: 'select',
    dicData: [{
      label: '是',
      value: '1'
    }, {
      label: '否',
      value: '0'
    }],
    search: true,
    searchLabelWidth: 100
  },{
    label: '是否修改现计划',
    prop: 'whetherStatus',
    type: 'select',
    search: true,
    dicData: [
      {
        label: '是',
        value: '1'
      }, {
        label: '否',
        value: '0'
      }
    ],
    addDisplay: false,
    editDisplay: false
  },{
    label: '运营商',
    prop: 'operator',
    display: false,
    search: true
  },{
    label: '备注',
    prop: 'remark',
    type: 'input',
    cell: true,
    width: 200
    //type: 'textarea',
    // maxRows:6,
    // minRows:4
  }, {
    label: '创建人ID',
    prop: 'creatorId',
    hide: true,
    display: false
  }, {
    label: '创建人名称',
    prop: 'creatorName',
    hide: true,
    display: false
  }, {
    label: '创建时间',
    prop: 'createtime',
    hide: true,
    display: false
  }]
};

export const tableOptionEdit = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  dialogWidth:'70%',
  printBtn: false,
  searchSize: 'mini',
  addBtn: false,
  delBtn: false,
  editBtn: false,
  column: [{
    label: '标识',
    prop: 'id',
    hide: true,
    display: false
  }, {
    label: '单号',
    prop: 'numbers',
    disabled: true,
  }, {
    label: '作业时间',
    prop: 'workTime',
    type: 'year',
    format: 'yyyy',
    valueFormat: 'yyyy',
    search: true,
    searchValue: nowYear, 
    disabled: true,
    searchLabelWidth: 100
  }, {
    label: '周期',
    prop: 'workCycle',
    type: 'select',
    dicUrl: '/admin/dict/type/plan_cycle',
    search: true,
    disabled: true,
    rules: [{
      required: true,
      message: '请选择周期',
      trigger: 'blur'
    }]
  }, {
    label: '月份',
    prop: 'planMonth',
    disabled: true,
    formatter: (row,value,label,column) => {
      if(value){
        return value.split(',').map(m=>m+'月').join(',')
      }
    }
  }, {
    label: '已分解月份',
    prop: 'decomposeMonth',
    disabled: true,
    formatter: (row,value,label,column) => {
      if(value){
        return value.split(',').map(m=>m+'月').join(',')
      }
    }

  }, {
    label: '工作类型',
    prop: 'planType',
    type: 'select',
    dicUrl: '/admin/dict/type/plan_type',
    disabled: true,
    rules: [{
      required: true,
      message: '请选择计划类型',
      trigger: 'blur'
    }]
  }, {
    label: '票种',
    prop: 'ticketType',
    type: 'select',
    dicUrl: '/support/swpmticketcardtype/dict',
    props: {
      label: 'mainName',
      value: 'mainEnName'
    },
    search: true,
    disabled: true,
    rules: [{
      required: true,
      message: '请选择票种',
      trigger: 'blur'
    }]
  }, {
    label: '原计划数量',
    prop: 'planNumberOld',
    type: 'number',
    precision: 0,
    disabled: true,
    rules: [{
      required: true,
      message: '请输入原计划数量',
      trigger: 'blur'
    }]
  }, {
    label: '现计划数量',
    prop: 'planNumberNow',
    type: 'number',
    precision: 0,
    cell: true,
    rules: [{
      required: true,
      message: '请输入现计划数量',
      trigger: 'blur'
    }],
    width: 150
  }, {
    label: '已分解数量',
    prop: 'decomposeNumber',
    type: 'number',
    disabled: true,
    precision: 0,
    rules: [{
      required: true,
      message: '请输入已分解数量',
      trigger: 'blur'
    }]
  }, {
    label: '审批状态',
    prop: 'checkStatus',
    type: 'select',
    dicUrl: '/admin/dict/type/check_status',
    search: true,
    searchValue: '0', 
    addDisplay: false,
    editDisplay: false
  }, {
    label: '审核人',
    prop: 'checkPersonId',
    hide: true,
    addDisplay: false,
    editDisplay: false
  }, {
    label: '审核时间',
    prop: 'checkTime',
    hide: true,
    addDisplay: false,
    editDisplay: false
  }, {
    label: '是否分解完毕',
    prop: 'isDecompose',
    type: 'select',
    dicData: [{
      label: '是',
      value: '1'
    }, {
      label: '否',
      value: '0'
    }],
    search: true,
    searchLabelWidth: 100
  },{
    label: '是否修改现计划',
    prop: 'whetherStatus',
    type: 'select',
    search: true,
    dicData: [
      {
        label: '是',
        value: '1'
      }, {
        label: '否',
        value: '0'
      }
    ],
    addDisplay: false,
    editDisplay: false
  },{
    dataType: "string",
    type: "upload",
    label: "附件",
    prop: "receiptFilePath",
    cell: true,
    component: "zd-upload",
    limit: 1,
    width: 120
  }, {
    label: '备注',
    prop: 'remark',
    type: 'input',
    cell: true,
    width: 200
  }, {
    label: '创建人ID',
    prop: 'creatorId',
    hide: true,
    display: false
  }, {
    label: '创建人名称',
    prop: 'creatorName',
    hide: true,
    display: false
  }, {
    label: '创建时间',
    prop: 'createtime',
    hide: true,
    display: false
  }]
};

export const tableOptionView = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  dialogWidth:'70%',
  printBtn: false,
  searchSize: 'mini',
  addBtn: false,
  delBtn: false,
  editBtn: false,
  selection: true,
  selectable: row => {
    return row.checkStatus == '0' || row.checkStatus == '3'
  },
  searchMenuSpan: 6,
  column: [{
    label: '标识',
    prop: 'id',
    hide: true,
    display: false
  }, {
    label: '单号',
    prop: 'numbers',
    disabled: true,
  }, {
    label: '作业时间',
    prop: 'workTime',
    type: 'year',
    format: 'yyyy',
    valueFormat: 'yyyy',
    search: true,
    searchValue: nowYear, 
    disabled: true,
    searchLabelWidth: 100
  }, {
    label: '周期',
    prop: 'workCycle',
    type: 'select',
    dicUrl: '/admin/dict/type/plan_cycle',
    search: true,
    disabled: true,
    rules: [{
      required: true,
      message: '请选择周期',
      trigger: 'blur'
    }]
  }, {
    label: '月份',
    prop: 'planMonth',
    disabled: true,
    formatter: (row,value,label,column) => {
      if(value){
        return value.split(',').map(m=>m+'月').join(',')
      }
    }
  }, {
    label: '已分解月份',
    prop: 'decomposeMonth',
    disabled: true,
    formatter: (row,value,label,column) => {
      if(value){
        return value.split(',').map(m=>m+'月').join(',')
      }
    }

  }, {
    label: '工作类型',
    prop: 'planType',
    type: 'select',
    dicUrl: '/admin/dict/type/plan_type',
    disabled: true,
    rules: [{
      required: true,
      message: '请选择计划类型',
      trigger: 'blur'
    }]
  }, {
    label: '票种',
    prop: 'ticketType',
    type: 'select',
    dicUrl: '/support/swpmticketcardtype/dict',
    props: {
      label: 'mainName',
      value: 'mainEnName'
    },
    search: true,
    disabled: true,
    rules: [{
      required: true,
      message: '请选择票种',
      trigger: 'blur'
    }]
  }, {
    label: '原计划数量',
    prop: 'planNumberOld',
    type: 'number',
    precision: 0,
    disabled: true,
    rules: [{
      required: true,
      message: '请输入原计划数量',
      trigger: 'blur'
    }]
  }, {
    label: '现计划数量',
    prop: 'planNumberNow',
    type: 'number',
    precision: 0,
    cell: true,
    rules: [{
      required: true,
      message: '请输入现计划数量',
      trigger: 'blur'
    }],
    width: 150
  }, {
    label: '已分解数量',
    prop: 'decomposeNumber',
    type: 'number',
    disabled: true,
    precision: 0,
    rules: [{
      required: true,
      message: '请输入已分解数量',
      trigger: 'blur'
    }]
  }, {
    label: '审批状态',
    prop: 'checkStatus',
    type: 'select',
    dicUrl: '/admin/dict/type/check_status',
    search: true,
    searchValue: '0', 
    addDisplay: false,
    editDisplay: false
  }, {
    label: '审核人',
    prop: 'checkPersonId',
    hide: true,
    addDisplay: false,
    editDisplay: false
  }, {
    label: '审核时间',
    prop: 'checkTime',
    hide: true,
    addDisplay: false,
    editDisplay: false
  }, {
    label: '是否分解完毕',
    prop: 'isDecompose',
    type: 'select',
    dicData: [{
      label: '是',
      value: '1'
    }, {
      label: '否',
      value: '0'
    }],
    search: true,
    searchLabelWidth: 100
  },{
    label: '是否修改现计划',
    prop: 'whetherStatus',
    type: 'select',
    search: true,
    dicData: [
      {
        label: '是',
        value: '1'
      }, {
        label: '否',
        value: '0'
      }
    ]
  },
  {
    type: "upload",
    label: "回执单附件路径",
    prop: "receiptFilePath",
    slot: true
  }, {
    label: '备注',
    prop: 'remark',
    type: 'input',
    cell: true,
    width: 200
  }, {
    label: '创建人ID',
    prop: 'creatorId',
    hide: true,
    display: false
  }, {
    label: '创建人名称',
    prop: 'creatorName',
    hide: true,
    display: false
  }, {
    label: '创建时间',
    prop: 'createtime',
    hide: true,
    display: false
  }]
};

